<?php
/**
 *
 * @todo description of this class
 *
 * @author Alton Crossley <crossleyframework@nogahidebootstrap.com>
 * @package Crossley Framework
 *
 * @copyright Copyright (c) 2003-2011, Nogaide BootStrap INC. All rights reserved.
 * @license BSD http://opensource.org/licenses/bsd-license.php
 * @version $Id:$
 *
 */

/**
 * @namespace
 */
namespace X\Controller;

/**
 * purpose: to construct the Standard Object Response for the Controller
 *
 * @author Alton Crossley
 * @package Crossley Framework
 * @version 0.3
 *
 */
Interface Response
{
    /**
     * 	Add a global error message
     *
     * 	@param string $sError
     */
    public function addError($Error);

    /**
     * Set all errors as an array
     *
     * @param array $aErrors
     */
    public function setErrors(array $Errors);

    /**
     * check to see if there are errors in the response
     *
     * @return bool
     */
    public function hasErrors();

    /**
     * 	Remove errors
     *
     */
    public function removeErrors();

    /**
     * retrieve error messages array
     *
     * @return array
     */
    public function getErrors();

    /**
     * 	Add any kind of data *by key*
     * 	(aForm and aValidationErrors are reserved)
     *
     * 	@param string $sKey
     * 	@param mixed $mValue
     */
    public function addData($Key, $Value);

    /**
     * 	Add form data (field/value)
     *
     * 	@param array $aFormData
     */
    public function addFormData(array $FormData, $Merge = false);
    /**
     * get form values
     * 
     * @return array
     */
    public function getFormData();
    /**
     * set the return html
     * 
     * @param string $Html
     * @return void
     */
    public function Html($Html = null);

    /**
     * 	Add validation errors
     * 	(error messages keyed by dom id)
     *
     * @param array $aValidationErrors
     * @return void
     */
    public function addValidationErrors(array $ValidationErrors);

    /**
     * 	Does this reponse have validation errors?
     *
     * 	@return boolean
     */
    public function hasValidationErrors();

    /**
     * direct access to the result data
     * this overwrites any data currently in place
     *
     * @param unknown_type $Data
     */
    public function setData($Data);

    /**
     * Set the name used in rendering this response
     *
     * @param string $Name
     */
    public function setRenderName($Name);

    /**
     * retrieve the name used to render the response
     *
     * @return string
     */
    public function getRenderName();
    /**
     * Get and/or Set the response output method using class constants
     *
     * @param string $Mode
     */
    public function OutputMethod($Mode = null);

    /**
     * standard toString returns JSON array
     *
     * @return srting
     */
    function __toString();
}